package com.dlc.shop.bean.event;

import com.dlc.shop.bean.app.dto.ShopCartItemDto;
import com.dlc.shop.bean.app.vo.ProductVO;
import com.dlc.shop.bean.dto.TransportDto;
import com.dlc.shop.bean.model.UserAddr;
import lombok.Data;

import java.util.List;
import java.util.Map;

/**
 * @author lanhai
 * 判断配送区域是否超出
 */
@Data
public class CheckAddrEvent {

    public CheckAddrEvent() {
    }

    public CheckAddrEvent(UserAddr userAddr, String userId, ProductVO productVO, List<ShopCartItemDto> shopCartItemList) {
        this.userAddr = userAddr;
        this.userId = userId;
        this.productVO = productVO;
        this.shopCartItemList = shopCartItemList;
    }

    public CheckAddrEvent(Long addrId, String userId, ProductVO productVO, List<ShopCartItemDto> shopCartItemList) {
        this.addrId = addrId;
        this.userId = userId;
        this.productVO = productVO;
        this.shopCartItemList = shopCartItemList;
    }

    /**
     * 用户id
     */
    private String userId;

    /**
     * 用户地址id
     */
    private Long addrId;

    /**
     * 用户地址
     */
    private UserAddr userAddr;

    /**
     * 商品详情信息
     */
    ProductVO productVO;

    /**
     * 购物车商品信息列表
     */
    List<ShopCartItemDto> shopCartItemList;
    /**
     * 模板集合-查询一次就行，保存到地址中，避免重复查询数据库
     */
    Map<Long, TransportDto> transportMap;
}
